
local cmdname = "aids_tele"

if CLIENT then

	AIDS.RegisterCommand( "Teleport", cmdname, "teleport" ) 

else
	
	local function TeleportPlayer( ply, cmd, args )
	
		local target = AIDS.GetPlayer( args[1] )
		
		if target then
		
			local trace = {}
			trace.start = target:GetShootPos()
			trace.endpos = trace.start + target:GetAimVector() * 9000
			trace.filter = target
			
			local tr = util.TraceLine( trace )
		
			target:SetPos( tr.HitPos + tr.HitNormal * 5 )
			
			AIDS.ChatPrint( { target, " was teleported to where they were looking." } )
		
		end
	
	end
	
	AIDS.AddCommand( TeleportPlayer, cmdname )
	
end